home *** CD-ROM | disk | FTP | other *** search
- //
- // Every now and then I've tried to create a realistic cloud texture.
- // I finally feel like I've succeeded :-).
- //
- // Jussi Kantola (jkantola@paju.oulu.fi)
- //
-
- #include "colors.inc"
- #include "textures.inc"
-
- #declare Sky_Top = 100 // The distance from ground to the top of the sky
-
- // A few different color_maps for the clouds, all of these are ok.
-
- #declare Colors1 = color_map
- {
- [0.0 0.1 color rgb <2/3, 2/3, 1> color rgb <2/3, 2/3, 1>]
- [1.0 color White]
- }
-
- #declare Colors2 = color_map // Realistic
- {
- [0.0 0.1 color SkyBlue color SkyBlue]
- [1.0 color White]
- }
-
- #declare Colors3 = color_map // Very realistic!
- {
- [0.0 0.1 color SkyBlue color SkyBlue]
- [0.70 color rgb <4/5, 4/5, 5/6>]
- [1.0 color White]
- }
-
- #declare Storm = color_map // looks quite heavy with SkyColor in the lower layer!
- {
- [0.0 0.1 color Clear color Clear]
- [0.70 color rgbf <4/5, 4/5, 5/6, 1/2>]
- [1.0 color White]
- }
-
- #declare CloudSky = texture // this is the cloud texture
- {
- pigment
- {
- bozo
- turbulence 0.5
- octaves 3 // doesn't have much effect
- lambda 6 // bigger values are worth trying
- color_map { Colors3 }
- }
- finish { ambient 1 diffuse 0 }
- scale 1/6 // please notice
- }
-
- camera
- {
- location <0, 1, -5>
- right 4/3*x
- direction z
- up y
- look_at <0, 1, 0>
- }
-
- light_source { <3, 8, -2> color rgb <1, 1, 1> }
- light_source { <1, 4, -6> color rgb <1, 1, 1> }
-
- plane // a ground plane
- {
- y, 0
- pigment
- {
- hexagon
- color rgb <1, 1, 1>
- color rgb <2/3, 1/3, 1/3>
- color rgb <1/3, 0, 0>
- }
- finish { ambient 0.05 diffuse 0.95 brilliance 3 }
- }
-
- sphere // something to stare at, a bumpy mirror sphere
- {
- <0, 1, 0>, 1
- pigment { color White }
- normal { bumps 3/4 scale 1/10 }
- finish { Mirror }
- }
-
- sphere // the sky globe -- please notice the scalings!
- {
- <0, 0, 0>, 1
- // texture { pigment { color SkyBlue } }
- texture { CloudSky }
- scale <Sky_Top*10, Sky_Top, Sky_Top*10>
- }
-
-